<!DOCTYPE html>
<html>
<head>
    <% include ../include/css_header.html %>
    <link type="text/css" rel="stylesheet" href="/bootstrapSwitch.css" />
    <style>
        .user_bg{
            background: url("/fj_bg_4.jpg") no-repeat;
            background-position: center top;
            background-size: 100% 100px;
            height: 100%;
            position: absolute;
            width: 100%;
            background-color: #fff;
        }
        .card_headlogo{
            border: 2px solid #e0e0e0;
            bottom: -1px;
            position: absolute;
        }
    </style>
</head>
<body>
<div class="container user_bg">
    <div class="top_bar">
        <a class="icon-arrow-left bar_left" onclick="javascript:window.history.go(-1)"></a>
        <!--<a class="icon-cog bar_right" href="#" style=""></a>-->
    </div>
    <div class="row">
        <div class="col-xs-12" style="height: 100px;position: relative;">
            <img src="/img/<%=user.id %>" alt="logo" class="img-circle card_headlogo" onError="this.src='/fj_default_headimg';"/>
        </div>
    </div>
    <div class="row" style="height: 20px;"></div>
    <div style="min-height: 380px;">
        <div class="row">
            <div class="col-xs-12">
                <h5><strong>向<a>我的人脉</a>公开资料：</strong></h5>
            </div>
        </div>
        <div class="well" style="height: 240px;">
            <div class="row">
                <div class="col-xs-8">
                    <label>电话：</label><%=card.mobile %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="mobile"
                        <% if(permission){ %>
                        <%=permission.showMobile? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <label>Email：</label><%=card.email %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="email"
                        <% if(permission){ %>
                        <%=permission.showEmail? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <label>公司：</label><%=card.company %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="company"
                        <% if(permission){ %>
                        <%=permission.showCompany? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <label>职位：</label><%=card.position %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="position"
                        <% if(permission){ %>
                        <%=permission.showPosition? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <label>行业：</label><%=card.business %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="business"
                        <% if(permission){ %>
                        <%=permission.showBusiness? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <label>服务/产品：</label><%=card.product %>
                </div>
                <div class="col-xs-4">
                    <div class="switch switch-small" data-on="primary" data-off="danger" data-on-label="公开" data-off-label="保密">
                        <input type="checkbox" value="" id="product"
                        <% if(permission){ %>
                        <%=permission.showProduct? 'checked' : ''%>
                        <% }else{ %>
                        ''
                        <% } %>/>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <% include ../include/copyright.html %>
</div>
<% include ../include/js_footer.html %>
<script src="/compoments/bootstrapSwitch.js"></script>
<script>
    var userId = '<%=user.id %>';
    $(function(){
        $('.switch').on('switch-change', function(e, data){
            var $el = $(data.el), value = data.value;
            setPrivacy($el.val(), value, $el.attr('id'));
        })
    })
    function setPrivacy(faction, flag, colume){
        $.post('/savePrivacy',
                {flag: flag, colume: colume},
                function(res){
            if(res.error){
                AlertBox.showTip('操作失败');
            }
        })
    }
</script>
</body>
</html>